// 计算属性名称
const x = 1, y = 2, z = 3;
console.log({x, y, z}); // {x: 1, y: 2, z: 3}

// 控制台跟踪（）
const outer = () => {
  const inner = () => console.trace('Hello');
  inner();
};

outer();
/*
Trace: Hello
    at inner (/Users/Mr-luo/个人项目/30SecondCode/console.log提示和技巧.js:7:31)
    at outer (/Users/Mr-luo/个人项目/30SecondCode/console.log提示和技巧.js:8:3)
    at Object.<anonymous> (/Users/Mr-luo/个人项目/30SecondCode/console.log提示和技巧.js:11:1)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
*/

// 控制台.group()
console.group('Outer');           // Create a group labelled 'Outer'
console.log('Hello');             // Log inside 'Outer'
console.groupCollapsed('Inner');  // Create a group labelled 'Inner', collapsed
console.log('Hellooooo');         // Log inside 'Inner'
console.groupEnd();               // End of current group, 'Inner'
console.groupEnd();               // End of current group, 'Outer'
console.log('Hi');                // Log outside of any groups

// 日志级别
console.debug('Debug message');
console.info('Useful information');
console.warn('This is a warning');
console.error('Something went wrong!');

// 控制台断言（）
const value = 10;
console.assert(value === 10, 'Value is not 10!'); // ""
console.assert(value === 20, 'Value is not 20!'); // "Value is not 20!"

// 控制台计数（）
Array.from({ length: 4 }).forEach(
  () => console.count('items')
);
/*
  items: 1
  items: 2
  items: 3
  items: 4
*/
console.countReset('items');  // 重置'items'计数

// 控制台时间（）
console.time('slow comp');    // Start the 'slow comp' timer
console.timeLog('slow comp'); // Log the value of the 'slow comp' timer
console.timeEnd('slow comp'); // Stop and log the 'slow comp' timer

// CSS
console.log(
  'CSS can make %cyour console logs%c %cawesome%c!',  // String to format
  // Each string is the CSS to apply for each consecutive %c
  'color: #fff; background: #1e90ff; padding: 4px',   // Apply styles
  '',                                                 // Clear any styles
  'color: #f00; font-weight: bold',                   // Apply styles
  ''                                                  // Clear any styles
);